package com.tyf.easyEs.model;


import lombok.Data;
import lombok.experimental.Accessors;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@IndexName("student")
public class Student {

    /** 学生ID */
    @IndexId
    private String id ;
    /** 学生姓名 */
    private String name ;
    /** 学生性别 */
    private String gender ;
    /** 学生生日 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH::ss")
    private LocalDateTime birthday ;
    /** 学生住址 */
    private String address ;
    /** 学生联系方式 */
    private String phone ;

    public Student addBirthday() {
        this.birthday = LocalDateTime.now();
        this.address = "";
        this.gender = "";
        this.phone = "18651060509";
        return this;
    }
}
